package com.lambkit.core.flow.workflow;

import com.lambkit.core.flow.FlowContext;
import com.lambkit.core.flow.NodeType;
import com.lambkit.core.flow.annotion.FlowNode;

/**
 * 工作流引擎
 * @author yangyong(孤竹行)
 */
public class WorkFlowEngine {
    // 流程实例执行器
//    public void execute(WorkFlowInstance instance) {
//        WorkFlowNode currentNode = instance.getCurrentNode();
//        while (currentNode != null) {
//            processNode(currentNode, instance);
//            if (currentNode.getType() == NodeType.END) break;
//            currentNode = currentNode.getNextNode(instance.getVariables());
//        }
//    }
//
//    private void processNode(WorkFlowNode node, WorkFlowInstance instance) {
//        if (node instanceof TaskNode) {
//            Task task = createTask((TaskNode)node, instance);
//            taskQueue.add(task); // 任务进入待处理队列
//        }
//        instance.setCurrentNode(node);
//        instance.updateStatus(); // 更新实例状态到数据库
//    }
}
